package com.bjpowernode.gateway.web.model.query;

import com.bjpowernode.gateway.common.utils.KqUtil;
import com.bjpowernode.gateway.common.utils.Pkipair;
import lombok.Data;

/**
 * 查询订单接口  的  数据模型  -- 接收商户要查询订单的数据
 */
@Data
public class TradeSelectOrderQuery {

    private String userNo;

    private String appKey;

    private String orderNo;

    private String timestamp;

    private String sign;

    /**
     * 检查签名
     * @return
     */
    public boolean checkSignMsg() {
        String merchantSignMsgVal = "";
        merchantSignMsgVal = KqUtil.appendParam(merchantSignMsgVal,"userNo", userNo);
        merchantSignMsgVal = KqUtil.appendParam(merchantSignMsgVal, "appKey",appKey);
        merchantSignMsgVal = KqUtil.appendParam(merchantSignMsgVal, "orderNo",orderNo);
        merchantSignMsgVal = KqUtil.appendParam(merchantSignMsgVal, "timestamp",timestamp);
        System.out.println("merchantSignMsgVal="+merchantSignMsgVal);
        Pkipair pki = new Pkipair();
        boolean flag = pki.enCodeByCer(merchantSignMsgVal, sign);
        return flag;
    }
}
